package com.example.day03_2_consumer;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.SpringCloudApplication;
import org.springframework.cloud.client.circuitbreaker.EnableCircuitBreaker;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

/*@SpringBootApplication
@EnableDiscoveryClient
@EnableCircuitBreaker*/
@SpringCloudApplication //包含了上面三个注解
@EnableFeignClients//开启feign
public class Day032ConsumerApplication {

    public static void main(String[] args) {
        SpringApplication.run(Day032ConsumerApplication.class, args);
    }

    @Bean
    @LoadBalanced//使用负载均衡来请求地址
    public RestTemplate restTemplate(){
        return new RestTemplate();
    }
}
